package com.leo.erp.service;

import java.util.List;

import javax.servlet.http.HttpServletRequest;

import com.leo.erp.dto.AccountExecution;
import com.leo.erp.entity.AccountVo4InOutList;
import com.leo.erp.util.GlobalRuntimeException;

public interface AccountService {
	
	/**
	 * 分页查询收支列表
	 * @param accountId
	 * @param currentPage
	 * @param pageSize
	 * @return
	 */
	List<AccountVo4InOutList> findAccountInOutList(int accountId, Integer currentPage, Integer pageSize);
	
	/**
	 * 分页查询信息
	 * @param name
	 * @param serialNo
	 * @param remark
	 * @param currentPage
	 * @param pageSize
	 * @return
	 */
	AccountExecution getList(String name, String serialNo, String remark, int currentPage, int pageSize);
	Double getAccountSum(Object accountId, String timeStr, String type);
	Double getAccountSumByHead(Object accountId, String timeStr, String type);
	Double getAccountSumByDetail(Object accountId, String timeStr, String type);
	Double getManyAccountSum(Object accountId, String timeStr, String type);
	
	/**
	 * 修改帐户信息
	 * @param beanJson
	 * @param accountId
	 * @param request
	 * @return
	 */
	AccountExecution updateAccount(String beanJson, int accountId, HttpServletRequest request);
	
	/**
	 * 设置默认
	 * @param isDefault
	 * @param accountId
	 * @return
	 */
	AccountExecution updateAmountIsDefault(int isDefault, int accountId);
	
	/**
	 * 正常删除，要考虑数据完整性，进行完整性校验
	 * @param ids
	 * @return
	 */
	AccountExecution batchDeleteAccountByIdsNormal(String ids);
	int batchDeleteAccountByIds(String ids);
	
	/**
	 * 获取帐户信息列表
	 * @return
	 */
	AccountExecution getAccount();
	
	/**
	 * 插入
	 * @param beanJson
	 * @param request
	 * @return
	 * @throws GlobalRuntimeException
	 */
	AccountExecution insertAccount(String beanJson, HttpServletRequest request) throws GlobalRuntimeException;
	
	/**
	 * 查询名称是否存在
	 * @param id
	 * @param name
	 * @return
	 */
	AccountExecution checkIsNameExist(int id, String name);
	
	/**
	 * 获取统计信息
	 * @return
	 */
	AccountExecution getStatistics();
}
